#ifndef __TEXTFIELD__HPP__
#define __TEXTFIELD__HPP__

#include <ctype.h>
#include <string>
#include <list>
#include <SDL.h>

#include "fontmap.hpp"
#include "textbuffer.hpp"
#include "Ielement.hpp"

class TextField : public IElement
{
public:

  TextField(IElement*, SDL_Surface*, FontMap*);
  ~TextField();

  void SetBuffer(TextBuffer*);

private:

  //Ielement interface
  void update();
  void render(int x, int y);

  //-------
  
  int drawChar(int x, int y, unsigned char ch);
  int drawString(int x, int y, std::string * str);

  TextBuffer* buffer_;
  FontMap* fMap_;
};

#endif
